<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

<%@ taglib prefix="s" uri="/struts-tags" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
    	<link rel="stylesheet" type="text/css" media="all" href="<s:url value='/css/main.css'/>" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Aplicação</title>
        <style type="text/css">
<!--
.style1 {font-size: 14px}
.style3 {font-size: 18px}
-->
        </style>
</head>
    <body>
    <div id="tudo">
<div id="conteudo">
<form action="Voto!execute.do" method="POST">
  <div align="center"><h1>Voto</h1></div>
  <table width="459" border="0" align="center" cellpadding="0" cellspacing="4">
    <tr>
	   <td colspan="2">
	         <s:actionerror />
	         <s:actionmessage/>
	         <s:fielderror />
	   </td> 
   </tr>
    <tr>
    	<td>
    		<s:textfield name="nomeAluno" size="40" maxlength="100" label="Aluno" disabled="true"></s:textfield>
    		<s:hidden name="idAluno"></s:hidden>
    		
    		<s:textfield name="codTurma" size="20" maxlength="100" label="Turma" disabled="true"></s:textfield>
    		<s:hidden name="idTurma"></s:hidden>  
    	
	      <s:textfield name="nomeTarefa" size="40" maxlength="100" label="Tarefa" disabled="true"></s:textfield>
	      <s:hidden name="idTarefa"></s:hidden>
    	</td>
    </tr>
    <tr><td>Trabalhos:</td></tr>
    <s:if test="postados != null">
	      <s:checkboxlist list="postados" theme="checkbox-fix"
	      		label="Votar" labelposition="left"
	      		name="escolhidos"	listKey="id" 
	      		listValue="nomeArquivo" />
	</s:if>
	<tr>
		<td colspan="5" rowspan="2" valign="bottom" align="center"> 
      		<s:if test="postados != null">
        		<input type="submit" name="salvar" id="salvar" value="Salvar" />
      		</s:if>
        	<input type="submit" name="menu" id="menu" value=" Menu " />
     	</td>
    </tr>    
    <s:if test="postados != null">
    <tr><td><p>&nbsp;</p></td></tr>    
		<tr>
	    	<td  colspan="4">
	    		<table align="center" cellpadding="4" cellspacing="4">
	    			<th>Nome</th>
	    			<th>Visualizar</th>
	    			<s:iterator value="postados">
	    			<tr>
	    				<td><s:property value="nomeArquivo"/> </td>
	    				<s:url id="downloadDocumento" action="Voto!baixarArquivoAnexo"><s:param name="idPostado" value="id"/></s:url>	 
	    				<td><s:a theme="ajax" href="%{downloadDocumento}">Download</s:a></td>   			  
	    			</tr> 				
	    			</s:iterator>
	    		</table>
	    	</td>
	   	</tr>	    
    </s:if>	     
  </table>
  <p>&nbsp;</p>
</form>
</div>
</div>
</body>
</html>
